


#include"stl_deque.h"
#include"stl_.h"


void print_deque(Deque deque)
{
	printfs("  \r\n >>  ");
	for (int i = 0; i < deque_count(deque); i++) {
		printfs(" %d ,", deque_index_head(deque, i, int));
	}
	printfs("     <<   <<   ");
	for (int i = 1; i <= deque_count(deque); i++) {
		printfs(" %d ,", deque_index_tail(deque, i, int));
	}
}

void test_deque()
{
	int ia[6] = { 1,2,3,4,5,6 };
	int ib[6] = { 0,0,0,0,0,0 };

	Deque di;
	deque_init(di, ib, 6);
	print_deque(di);

	for (int i = 0; i < 6; i++) {
		deque_push_back(di, ia[i], int);
		print_deque(di);
	}
	for (int i = 0; i < 6; i++) {
		deque_pop_front(di);
		print_deque(di);
	}
	for (int i = 0; i < 6; i++) {
		deque_push_front(di, ia[i], int);
		print_deque(di);
	}
	for (int i = 0; i < 6; i++) {
		deque_pop_back(di);
		print_deque(di);
	}


	for (int i = 0; i < 6; i++) {	
		deque_strong_push_back(di, ia[i], int);
		print_deque(di);
	}
	for (int i = 0; i < 6; i++) {
		deque_pop_back_n(di, 2);
		print_deque(di);
	}
	for (int i = 0; i < 6; i++) {
		deque_strong_push_front(di, ia[i], int);
		print_deque(di);
	}
	for (int i = 0; i < 6; i++) {
		deque_pop_front_n(di, 2);
		print_deque(di);
	}



}








